package com.javaweb.spring.service.impl;

import com.javaweb.spring.dao.UserDao;
import com.javaweb.spring.dao.impl.UserDaoImpl;
import com.javaweb.spring.pojo.User;
import com.javaweb.spring.service.UserService;

public class UserServiceImpl implements UserService {
    UserDao userDao=new UserDaoImpl();
    @Override
    public int login(String username, String password) {
        User user = userDao.findByName(username);
        if (user!=null) {
            if (password.equals(user.getPassword())) {
                return 1;
            }
            return 0;
        }else {
            return -1;
        }
    }
}
